package cn.bugio.note.auth;

import cn.bugio.note.common.vo.ServerResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Vincent Vic
 * @version 1.0
 * @Description
 * @since 2021/3/4
 */

@RestControllerAdvice
public class GlobalExceptionErrorHandler {

    @ExceptionHandler(Exception.class)
    public ServerResponse handler(Exception e){
        return ServerResponse.errorException(e.getMessage());
    }
}
